home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / CIT.v4 / Demo / WeightedDemo.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-13  |  2.9 KB  |  102 lines

  1. //
  2. // Weighted demo
  3. //
  4. #include <CITGroup.h>
  5. #include <CITButton.h>
  6.  
  7. #include <images/bevel.h>
  8.  
  9. CITApp Application;
  10.  
  11. CITWorkbench WeightedScreen;
  12. CITWindow    WeightedWindow;
  13.  
  14. CITVGroup winGroup;
  15. CITHGroup hTopGroup,fixedAndFreeGroup,hBotGroup;
  16. CITHGroup horizGroup;
  17. CITVGroup vertGroup;
  18.  
  19. CITButton vEmpty1,vEmpty2,vEmpty3;
  20. CITButton hEmpty1,hEmpty2,hEmpty3;
  21. CITButton w25,w50,w75,w100;
  22. CITButton free1,fixed1,free2,fixed2;
  23.  
  24. void closeEvent();
  25.  
  26. int main(void)
  27. {
  28.   BOOL Error=FALSE;
  29.  
  30.   WeightedScreen.InsObject(WeightedWindow,Error);
  31.     WeightedWindow.Position(1);
  32.     WeightedWindow.CloseGadget();
  33.     WeightedWindow.DragBar();
  34.     WeightedWindow.SizeGadget();
  35.     WeightedWindow.DepthGadget();
  36.     WeightedWindow.Activate();
  37.     WeightedWindow.Caption("CIT Weighted Layout Example");
  38.     WeightedWindow.CloseEventHandler(closeEvent);
  39.     WeightedWindow.InsObject(winGroup,Error);
  40.       winGroup.BevelStyle(BVS_GROUP);
  41.       winGroup.SpaceOuter();
  42.       winGroup.InsObject(hTopGroup,Error);
  43.         hTopGroup.SpaceOuter();
  44.         hTopGroup.InsObject(horizGroup,Error);
  45.           horizGroup.SpaceOuter();
  46.           horizGroup.BevelStyle(BVS_GROUP);
  47.           horizGroup.BevelLabel("Horizontal");
  48.           horizGroup.InsObject(vEmpty1,Error);
  49.           horizGroup.InsObject(vEmpty2,Error);
  50.           horizGroup.InsObject(vEmpty3,Error);
  51.         hTopGroup.InsObject(vertGroup,Error);
  52.           vertGroup.SpaceOuter();
  53.           vertGroup.BevelStyle(BVS_GROUP);
  54.           vertGroup.BevelLabel("Vertictal");
  55.           vertGroup.InsObject(hEmpty1,Error);
  56.           vertGroup.InsObject(hEmpty2,Error);
  57.           vertGroup.InsObject(hEmpty3,Error);
  58.       winGroup.InsObject(fixedAndFreeGroup,Error);
  59.         fixedAndFreeGroup.BevelStyle(BVS_SBAR_VERT);
  60.         fixedAndFreeGroup.BevelLabel("Free, Fixed and Weighted sizes.");
  61.         fixedAndFreeGroup.WeightedHeight(0);
  62.         fixedAndFreeGroup.InsObject(w25,Error);
  63.           w25.Text("25kg");
  64.           w25.WeightedWidth(25);
  65.         fixedAndFreeGroup.InsObject(w50,Error);
  66.           w50.Text("50kg");
  67.           w50.WeightedWidth(50);
  68.         fixedAndFreeGroup.InsObject(w75,Error);
  69.           w75.Text("75kg");
  70.           w75.WeightedWidth(75);
  71.         fixedAndFreeGroup.InsObject(w100,Error);
  72.           w100.Text("100kg");
  73.           w100.WeightedWidth(100);
  74.       winGroup.InsObject(hBotGroup,Error);
  75.         hBotGroup.WeightedHeight(0);
  76.         hBotGroup.MinWidth(300);
  77.         hBotGroup.InsObject(free1,Error);
  78.           free1.Text("Free");
  79.         hBotGroup.InsObject(fixed1,Error);
  80.           fixed1.Text("Fixed");
  81.           fixed1.WeightedWidth(0);
  82.         hBotGroup.InsObject(free2,Error);
  83.           free2.Text("Free");
  84.         hBotGroup.InsObject(fixed2,Error);
  85.           fixed2.Text("Fixed");
  86.           fixed2.WeightedWidth(0);
  87.  
  88.   Application.InsObject(WeightedScreen,Error);
  89.  
  90.   if( Error )
  91.     return 10;
  92.  
  93.   Application.Run();
  94.  
  95.   return 0;
  96. }
  97.  
  98. void closeEvent()
  99. {
  100.   Application.Stop();
  101. }
  102.